package livingarea.Members;

import livingarea.actions_impl.BigMove;
import livingarea.actions_impl.EatPray;
import livingarea.LivingArea;
import livingarea.actions_impl.PredatorDeath;
import livingarea.actions_impl.PredatorSpawn;

/**
 * Class that describe a predator beast.
 *
 * @author Muzalevskiy Vitaliy
 */
public class Predator extends Beast {
    
    /**Number of iterations current beast lives.*/
    public static final int DETH_TIME = 40;
    
    /**Max length value of current step.*/
    public static final int MAX_PREDATOR_MOVE = 4;
    
    /**How many prays need beast to eat before spawning.*/
    public static final int EAT_TO_SPOWN = 5;
    
    /**
     * Constructor of current class that create beast in entered living area
     * with random position.
     *
     * @param area - living area in which current beast will be created.
     */
    public Predator(LivingArea area){
        super(area);
        moveType = new BigMove(this);
        eatingType = new EatPray(this);
        spawnType = new PredatorSpawn(this);
        dethType = new PredatorDeath(this);
    }
    
    /**
     * Constructor of current class that create beast in entered living area
     * with position values indicated as parameters.
     *
     * @param area - living area in which current beast will be created.
     */
    public Predator(LivingArea area, Position position){
        super(area, position);
        moveType = new BigMove(this);
        eatingType = new EatPray(this);
        spawnType = new PredatorSpawn(this);
        dethType = new PredatorDeath(this);
    }

    @Override
    public void lifeCicle() {
        moveType.move();
        eatingType.eat();
        spawnType.spawn();
        dethType.die();
        increaseLifeCount();
    }

    @Override
    public boolean isPray() {
        return false;
    }
}
